package com.test.factoryBean;

import org.springframework.beans.factory.FactoryBean;
import org.springframework.stereotype.Component;

/**
 * 问:下面的名字是代表spring容器中的 MyObject对象 还是spring容器中的 MyFactoryBean对象???
 * 答:代表MyObject对象
 */
@Component("myFactoryBeanOrMyObject")
public class MyFactoryBean implements FactoryBean {
	@Override
	public Object getObject() throws Exception {
		return new MyObject();
	}

	@Override
	public Class<?> getObjectType() {
		return MyObject.class;
	}
}
